﻿<?php
function getConn(){
		$conn= &ADONewConnection();
		$conn->connect(HOST_ADDR,HOST_USER,HOST_PSW,DB_NAME);
		return $conn;
	}

class board extends DController
{
	
	
	public  function defaultKey(){
		$conn= &getConn();

		$xx='';
		$recordset= &$conn->execute("select * from diduo_threads");	
		if (!$recordset) 
        $xx.= $conn->ErrorMsg();
		else
				while (!$recordset->EOF) {
        $xx.= $recordset->fields['Tid'].' '.$recordset->fields['Subject'].'<BR>';
        $recordset->MoveNext();
      	}
			
		$this->tpl->assign('title',"主题列表页面");
    $this->tpl->assign('content',$xx);



	}

	public function post(){
		
		$conn=&getConn();
		$t=time();
		
		$conn->execute("insert into diduo_posts(Dateline,Message) values (${t},'${_POST['pp']}')");
		$this->tpl->assign('title', "测试一哈子撒");
		$this->tpl->assign('content','成功提交,<a href="index.php?play=test">返回查看</a>');
	}
} 
?>